home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / GMSV03B.lha / GamesMaster / Source / E / ScreenDemos / FadingDemo.e < prev    next >
Encoding:
Text File  |  1996-09-11  |  1.9 KB  |  85 lines

  1. /* Fade Demo
  2. ** ---------
  3. ** There are three examples of fading in this program:  Fade_To_White,
  4. ** Fade_To_Palette, and Fade_To_Black.
  5. **
  6. ** Press fire to see the end of the fade sequence.
  7. */
  8.  
  9. MODULE 'games','games/games'
  10.  
  11. PROC main()
  12.    DEF screen:PTR TO gamescreen, palette:PTR TO INT, fadestate=0:LONG,
  13.        loadpic:PTR TO picture
  14.  
  15.    palette := [    $0000,$0130,$0FCB,$0FA9,$0D88,$0965,$0644,$0211,
  16.         $0400,$0444,$0FF0,$0432,$0CC0,$0150,$0501,$0880,
  17.         $0261,$0271,$0382,$0492,$05A3,$05B4,$0677,$06C4,
  18.         $0788,$09AA,$0BCC,$0801,$0901,$0A02,$0701,$0601
  19.           ]:INT;
  20.  
  21.    screen :=  [    GSV1,0,
  22.         0,0,0,
  23.         0,
  24.         0,
  25.         0,
  26.         32,
  27.         320,256,320,256,
  28.         5,
  29.         0,0,
  30.         0,0,
  31.         0,
  32.         LORES,
  33.         INTERLEAVED,
  34.         0
  35.           ]:gamescreen;
  36.  
  37.    loadpic := [    PCV1,0,             -> Version header.
  38.         0,                  -> Destination.
  39.         320,256,            -> Width, Height.
  40.         5,                  -> Amount of Planes.
  41.         32,                 -> Amount of colours.
  42.         palette,            -> Palette (remap).
  43.         LORES,              -> Screen mode.
  44.         INTERLEAVED,        -> Destination.
  45.         0                   -> Parameters.
  46.               ]:picture;
  47.  
  48.    IF gmsbase := OpenLibrary('games.library',0)
  49.       SetUserPri()
  50.       IF (Add_Screen(screen) = ERR_OK)
  51.          loadpic.data := screen.memptr1;
  52.          IF (LoadPic('GAMESLIB:data/IFF.Pic320',loadpic) = ERR_OK)
  53.             Show_Screen(screen)
  54.         Wait_Time(30)
  55.  
  56.         REPEAT
  57.           Wait_VBL()
  58.           Wait_OSVBL()
  59.           fadestate := Col12_FadeToPalette(screen,fadestate,palette,0,32)
  60.         UNTIL (fadestate = 0)
  61.  
  62.         Wait_LMB()
  63.  
  64.         REPEAT
  65.           Wait_VBL()
  66.           Wait_OSVBL()
  67.           fadestate := Col12_FadeToWhite(screen,fadestate,0,32)
  68.         UNTIL (fadestate = 0)
  69.  
  70.         Wait_Time(30)
  71.  
  72.             REPEAT
  73.           Wait_OSVBL();
  74.           fadestate := Col12_FadeToBlack(screen,fadestate);
  75.         UNTIL (fadestate = 0);
  76.  
  77.         Wait_Time(50)
  78.          ENDIF
  79.     Delete_Screen(screen)        
  80.       ENDIF
  81.    CloseLibrary(gmsbase)
  82.    ENDIF
  83. ENDPROC
  84.  
  85.